
import request from "@/utils/request";

export default class ScreenApi {

    public static getServerTime() {
        return new Promise((resolve, reject) => {
            request({
                url: '/tr/screen/timestamp',
                method: 'get',
                params: {
                }
            }).then((res: any) => {
                console.log('get server time:::', res)
                if (res?.code === 200) {
                    resolve(res.data)
                } else {
                    reject(res)
                }
            }, (err) => reject(err))
        })
    }

    public static listScheduleEmpl() {
        return new Promise((resolve, reject) => {
            request({
                url: '/tr/screen/ysxx',
                method: 'get',
                params: {
                }
            }).then((res: any) => {
                    console.log('list schedule empl:::', res)
                if (res?.code === 200) {
                    resolve(res.data)
                } else {
                    reject(res)
                }
            }, (err) => reject(err))
        })
    }

    public static listYhxx() {
        return new Promise((resolve, reject) => {
            request({
                url: '/tr/screen/yhxx',
                method: 'get',
                params: {
                }
            }).then((res: any) => {
                console.log('list yhxx:::', res)
                if (res?.code === 200) {
                    resolve(res.data)
                } else {
                    reject(res)
                }
            }, (err) => reject(err))
        })
    }

    public static listTzxx() {
        return new Promise((resolve, reject) => {
            request({
                url: '/tr/screen/tzxx',
                method: 'get',
                params: {
                }
            }).then((res: any) => {
                console.log('list tzxx:::', res)
                if (res?.code === 200) {
                    resolve(res.data)
                } else {
                    reject(res)
                }
            }, (err) => reject(err))
        })
    }
}
